home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PROGEDIT
/
0773.ZIP
/
SEIOIBM.D
< prev
next >
Wrap
Text File
|
1988-01-03
|
6KB
|
132 lines
/*
* SEIOIBM.D : IBM PC dependent data structures ...
*
* Last updated: (see header message below)
*
*/
#define SEBIN "SE" /* SE executable name */
#define PCHELPFILE "se.hlp" /* help page filename */
#define PCROOTHELP "\\se.hlp\0 " /* " in root (or wherever) */
#define HOLDFILE "se.hld" /* intermediate hold file */
#define GETANSI "\033[6n\r" /* get ansi status sequence */
#define AUTO 0 /* argument order in */
#define WRAP 1 /* option structure */
#define TABINC 2
#define STLINE 3
#define STCOL 4
#define STMESSG 5
#define FILL 6
#define BROWSE 7
#define DIVLINES 8
#define STRIP8 9
#define INFILE 10
#define OUTFILE 11
#define NARGS 12 /* number of arguments */
typedef struct _header { char version;
char release;
char logon[50]; /* this is where the signon */
}; /* message resides */
struct _header header = { 1, 1,
"ECS Screen Editor, 04-Jan-88. " /* signon message */
};
static char *copyrite = "Copyright (C) 1988, Southampton University, UK.";
static char *logon_form = "%s%s(%s)\r\n%s\r\n";
/* ansi, signon, termid, copyrite */
typedef struct { char id; /* option letter id */
boolean swtch; /* switch (T) or value must follow (F) */
char *arg; /* actual or default value (can't use */
} oprec; /* union - trouble with initialiser) */
static oprec options[] = { /* # desc. */
{ 'a', TRUE, (char*) FALSE}, /* 0 auto indent mode */
{ 'w', TRUE, (char*) FALSE}, /* 1 wrap mode */
{ 't', FALSE, "8" }, /* 2 tab interval */
{ 'l', FALSE, "1" }, /* 3 start at line */
{ 'c', FALSE, "1" }, /* 4 start at column */
{ 'm', FALSE, (char*) NULL}, /* 5 start up message */
{ 'f', TRUE, (char*) FALSE}, /* 6 fill mode */
{ 'b', TRUE, (char*) FALSE}, /* 7 browse mode */
{ 'd', TRUE, (char*) FALSE}, /* 8 divide lines */
{ 'p', TRUE, (char*) FALSE}, /* 9 strip parity */
{ 0, 0, (char*) NULL}, /* 10 infile */
{ 0, 0, (char*) NULL}, /* 11 outfile */
{ 0, 0, (char*) 0}
};
static char *usg[] =
{ "",
"SE usage:",
" se [-abdfpw] [-t #] [-l #] [-c #] [-m msg] file [outfile]",
"",
"For help inside SE press <escape> then type HELP<return>.",
" Type <return> to get back to the text.",
NULL };
static boolean
fn_key = FALSE; /* true if function key macros in use */
typedef struct { int secode; /* SE opcode */
char termstr[3]; /* PC function key code */
} matchentry;
static matchentry matchtab[] = { /* key label */
{ k_help, 0, 71, 0xFF}, /* Home Function code strings */
{ k_backsp, 8, 0xFF, 0 }, /* <-grey end in 0xFF because 0 */
{ k_insert, 0, 82, 0xFF}, /* Ins is a fn.code lead-in */
{ k_scroldown,0, 118, 0xFF}, /* Ctrl.PgDn */
{ k_down, 0, 80, 0xFF}, /* \|/ */
{ k_downpage, 0, 81, 0xFF}, /* PgDn */
{ k_left, 0, 75, 0xFF}, /* <- */
{ k_dchar, 0, 83, 0xFF}, /* Del */
{ k_right, 0, 77, 0xFF}, /* -> */
{ k_scrolup, 0, 132, 0xFF}, /* Ctrl.PgUp */
{ k_up, 0, 72, 0xFF}, /* /|\ */
{ k_uppage, 0, 73, 0xFF}, /* PgUp */
{ k_wleft, 0, 115, 0xFF}, /* Ctrl.<- */
{ k_wright, 0, 116, 0xFF}, /* Ctrl.-> */
{ k_again, 0, 79, 0xFF}, /* End */
{ k_dline, 0, 59, 0xFF}, /* F1 */
{ k_rstone, 0, 60, 0xFF}, /* F2 */
{ k_restore, 0, 61, 0xFF}, /* F3 */
{ k_scrolup, 0, 62, 0xFF}, /* F4 */
{ k_wleft, 0, 63, 0xFF}, /* F5 */
{ k_wright, 0, 64, 0xFF}, /* F6 */
{ k_help, 0, 65, 0xFF}, /* F7 spare */
{ k_scroldown,0, 66, 0xFF}, /* F8 */
{ k_ignore, 0, 67, 0xFF}, /* F9 spare */
{ k_verify, 0, 68, 0xFF}, /* F10 */
{ 0, 0, 0, 0 }
};
static uchar
w_extn[] = {4, '.','$','$','$'},
b_extn[] = {4, '.','b','a','k'};
static int cur_start = 0; /* size of SE cursor (-1 for no change) */
static char *pairs[] = { /* each element MUST be distinct */
/* and be compatible with strmatch() */
"(\377", ")\377", /* brackets */
"[\377", "]\377",
"{\377", "}\377",
"/*\377", "*/\377", /* C, Pascal */
"$(\377", "$)\377", /* BCPL */
"begin\377", "end\377", /* Pascal, etc. */
"DO\377", "END\377", /* PL/M */
"#if\377", "#endif\377", /* C preproc. */
"\\begin\377","\\end\377", /* TeX */
NULL, NULL /* end of list */
};